/*
 *	生成游戏左边的小部件内容（人物、员工头像、勋章等）
 *	add by xijiangbo
 *	2010.05.15
 */
/*	widget.load({
 *		type:"character||fullWindow"
 *	});
 */
/*	widget.load({
 * 		type:"customize",
 * 		width:	'',
 * 		height:	'',
 * 		top:	'',
 * 		left:	'',
 *	});
 */
var widget = (function(){
    var oWidget = {};
    oWidget.load = function(winInnerHTML, win){

        $('host_right').style.width = '672px';
        $('host_right').style.height = '424px';
        $('host_right').style.left = '2px';
        $('host_right').style.top = '2px';
		$('host_right').style.padding = '4px';
        //重设host_right为大框状态，确保不会受js.js里的影响

        var winInnerHTML = winInnerHTML || '';
        var tLeftHTML = '';
        //s	字符串值，主窗口内的内容
        //win {winType,windowInformatcion}
        if (!win) {
            //设默认值
            var win = {
                type: 'character'
            }
        }
        var HTML = tpl[win.type](winInnerHTML);
        //把s传进去，打包成完整的可填充到host_right对像里的html结构

        return HTML;
    }
    var tpl = {
        //模版部分
        character: function(winInnerHTML){
            //人物形象、中等窗口，默认值
            //分显示勋章和不显示勋章两种情况

            var rightHTML = new public_Tpl.boxHTML({
                l: 140,
                t: 10,
                w: 516,
                h: 405,
                html: winInnerHTML,
                op: 90
            }).output();

            //左边的内容
            var s = new Array();
            s.push("<div style='position:absolute;top:30px;left:5px;width:150px;height:400px;text-align:center;'>左边的内容</div>");
            return s.join('') + rightHTML;
        },
        staff: function(winInnerHTML){
            //员工头像、中等窗口
        },
        secretary: function(winInnerHTML){
            //小秘书头像、中等窗口
        },
        fullSizeWindow: function(winInnerHTML){
            //全屏大窗口，有边框
        },
        miniWindow: function(winInnerHTML){

        },

        noBorder: function(winInnerHTML){
            //全屏大窗口,无边框
			return winInnerHTML;
        },
        customize: function(winInnerHTML){
            //自定义窗口(类似贝尔实验室的页面结构)
            /*arguments = {
             * 		background: url,
             * 		windowWidth: mini|middle|max|'800px',
             * 		leftWindw : {
             * 			img:	src,
             * 			html:	"要显示在图片下的内容，默认为空";
             * 		}
             * }
             */
        },
    }
    return oWidget;
})();
